package com.jbm.jsm.iface;

import com.jbm.core.iface.IAcross;
import org.hibernate.annotations.*;
import org.hibernate.annotations.Cache;

import javax.persistence.*;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.sql.Timestamp;
import java.util.List;

/**
 * Created by Administrator on 2017/9/26.
 */
@Entity
@Table(name = "small_account", schema = "", catalog = "jsm")
@org.hibernate.annotations.Entity(dynamicUpdate=true,dynamicInsert=true)
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
public class SmallAccountEntity extends IAcross
{
    private int saId;
    private Integer userId;
    private Integer platType;//平台codeproperty 1淘宝 2京东
    private Integer saLevel; //小号等级  codeproperty
    private Integer saSex; //性别
    private Integer priceS;//购买价格区间 低
    private Integer priceE;//购买价格区间 高
    private String memo;//小号 唯一账户名
    private String memoNew; //备注名
    private Float praiseRate; //好评率
    private Float refundRate;//退款率
    private Integer sDay;//日购买量
    private Integer sMonth;//月购买量
    private Integer sWeek;//周购买量
    private Integer iscert;//是否认证 未用
    private Timestamp updateDate;
    private Integer createId;
    private Timestamp createDate;
    private Integer isSeller;//是否卖家

    private String uName; //  未用
    private Integer iscz; //是否炒信
    private String saLevels; //  小号中文名
    private List<SmallAccountEntity> smallAccountList;
    private String birthday; //生日
    private String cookies; //
    private String saLevelen; //小戴用
    private Integer levelValue; //京享值
    private Integer waitReceive; //待收
    private Integer waitComment; //待评价


    public SmallAccountEntity()
    {
        super();
    }

    public SmallAccountEntity(IAcross ia)
    {
        super(ia);
    }

    @Id
    @Column(name = "sa_id")
    @GeneratedValue
    public int getSaId() {
        return saId;
    }

    public void setSaId(int saId) {
        this.saId = saId;
    }

    @Basic
    @Column(name = "user_id")
    public Integer getUserId() {
        return userId;
    }

    public void setUserId(Integer userId) {
        this.userId = userId;
    }

    @Basic
    @Column(name = "plat_type")
    public Integer getPlatType() {
        return platType;
    }

    public void setPlatType(Integer platType) {
        this.platType = platType;
    }

    @Basic
    @Column(name = "sa_level")
    public Integer getSaLevel() {
        return saLevel;
    }

    public void setSaLevel(Integer saLevel) {
        this.saLevel = saLevel;
    }

    @Basic
    @Column(name = "sa_sex")
    public Integer getSaSex() {
        return saSex;
    }

    public void setSaSex(Integer saSex) {
        this.saSex = saSex;
    }

    @Basic
    @Column(name = "price_s")
    public Integer getPriceS() {
        return priceS;
    }

    public void setPriceS(Integer priceS) {
        this.priceS = priceS;
    }

    @Basic
    @Column(name = "price_e")
    public Integer getPriceE() {
        return priceE;
    }

    public void setPriceE(Integer priceE) {
        this.priceE = priceE;
    }

    @Basic
    @Column(name = "memo")
    public String getMemo() {
        return memo;
    }

    public void setMemo(String memo) {
        this.memo = memo;
    }

    @Basic
    @Column(name = "memo_new")
    public String getMemoNew() {
        return memoNew;
    }

    public void setMemoNew(String memoNew) {
        this.memoNew = memoNew;
    }

    @Basic
    @Column(name = "praise_rate")
    public Float getPraiseRate() {
        return praiseRate;
    }

    public void setPraiseRate(Float praiseRate) {
        this.praiseRate = praiseRate;
    }

    @Basic
    @Column(name = "refund_rate")
    public Float getRefundRate() {
        return refundRate;
    }

    public void setRefundRate(Float refundRate) {
        this.refundRate = refundRate;
    }

    @Basic
    @Column(name = "s_day")
    public Integer getsDay() {
        return sDay;
    }

    public void setsDay(Integer sDay) {
        this.sDay = sDay;
    }

    @Basic
    @Column(name = "s_month")
    public Integer getsMonth() {
        return sMonth;
    }

    public void setsMonth(Integer sMonth) {
        this.sMonth = sMonth;
    }

    @Basic
    @Column(name = "s_week")
    public Integer getsWeek() {
        return sWeek;
    }

    public void setsWeek(Integer sWeek) {
        this.sWeek = sWeek;
    }

    @Basic
    @Column(name = "iscert")
    public Integer getIscert() {
        return iscert;
    }

    public void setIscert(Integer iscert) {
        this.iscert = iscert;
    }

    @Basic
    @Column(name = "update_date")
    public Timestamp getUpdateDate() {
        return updateDate;
    }

    public void setUpdateDate(Timestamp updateDate) {
        this.updateDate = updateDate;
    }

    @Basic
    @Column(name = "create_id")
    public Integer getCreateId() {
        return createId;
    }

    public void setCreateId(Integer createId) {
        this.createId = createId;
    }

    @Basic
    @Column(name = "create_date")
    public Timestamp getCreateDate() {
        return createDate;
    }

    public void setCreateDate(Timestamp createDate) {
        this.createDate = createDate;
    }

    @Basic
    @Column(name = "is_Seller")
    public Integer getIsSeller() {
        return isSeller;
    }

    public void setIsSeller(Integer isSeller) {
        this.isSeller = isSeller;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        SmallAccountEntity that = (SmallAccountEntity) o;

        if (saId != that.saId) return false;
        if (createDate != null ? !createDate.equals(that.createDate) : that.createDate != null) return false;
        if (createId != null ? !createId.equals(that.createId) : that.createId != null) return false;
        if (iscert != null ? !iscert.equals(that.iscert) : that.iscert != null) return false;
        if (memo != null ? !memo.equals(that.memo) : that.memo != null) return false;
        if (memoNew != null ? !memoNew.equals(that.memoNew) : that.memoNew != null) return false;
        if (platType != null ? !platType.equals(that.platType) : that.platType != null) return false;
        if (praiseRate != null ? !praiseRate.equals(that.praiseRate) : that.praiseRate != null) return false;
        if (priceE != null ? !priceE.equals(that.priceE) : that.priceE != null) return false;
        if (priceS != null ? !priceS.equals(that.priceS) : that.priceS != null) return false;
        if (refundRate != null ? !refundRate.equals(that.refundRate) : that.refundRate != null) return false;
        if (sDay != null ? !sDay.equals(that.sDay) : that.sDay != null) return false;
        if (sMonth != null ? !sMonth.equals(that.sMonth) : that.sMonth != null) return false;
        if (sWeek != null ? !sWeek.equals(that.sWeek) : that.sWeek != null) return false;
        if (saLevel != null ? !saLevel.equals(that.saLevel) : that.saLevel != null) return false;
        if (saSex != null ? !saSex.equals(that.saSex) : that.saSex != null) return false;
        if (updateDate != null ? !updateDate.equals(that.updateDate) : that.updateDate != null) return false;
        if (userId != null ? !userId.equals(that.userId) : that.userId != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = saId;
        result = 31 * result + (userId != null ? userId.hashCode() : 0);
        result = 31 * result + (platType != null ? platType.hashCode() : 0);
        result = 31 * result + (saLevel != null ? saLevel.hashCode() : 0);
        result = 31 * result + (saSex != null ? saSex.hashCode() : 0);
        result = 31 * result + (priceS != null ? priceS.hashCode() : 0);
        result = 31 * result + (priceE != null ? priceE.hashCode() : 0);
        result = 31 * result + (memo != null ? memo.hashCode() : 0);
        result = 31 * result + (memoNew != null ? memoNew.hashCode() : 0);
        result = 31 * result + (praiseRate != null ? praiseRate.hashCode() : 0);
        result = 31 * result + (refundRate != null ? refundRate.hashCode() : 0);
        result = 31 * result + (sDay != null ? sDay.hashCode() : 0);
        result = 31 * result + (sMonth != null ? sMonth.hashCode() : 0);
        result = 31 * result + (sWeek != null ? sWeek.hashCode() : 0);
        result = 31 * result + (iscert != null ? iscert.hashCode() : 0);
        result = 31 * result + (updateDate != null ? updateDate.hashCode() : 0);
        result = 31 * result + (createId != null ? createId.hashCode() : 0);
        result = 31 * result + (createDate != null ? createDate.hashCode() : 0);
        return result;
    }

    @Basic
    @Column(name = "u_name")
    public String getuName() {
        return uName;
    }

    public void setuName(String uName) {
        this.uName = uName;
    }

    @Basic
    @Column(name = "iscz")
    public Integer getIscz() {
        return iscz;
    }

    public void setIscz(Integer iscz) {
        this.iscz = iscz;
    }

    @Basic
    @Column(name = "sa_levels")
    public String getSaLevels() {
        return saLevels;
    }

    public void setSaLevels(String saLevels) {
        this.saLevels = saLevels;
    }

    @Transient
    @Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
    public List<SmallAccountEntity> getSmallAccountList() {
        return smallAccountList;
    }

    public void setSmallAccountList(List<SmallAccountEntity> smallAccountList) {
        this.smallAccountList = smallAccountList;
    }

    @Basic
    @Column(name = "birthday")
    public String getBirthday() {
        return birthday;
    }

    public void setBirthday(String birthday) {
        this.birthday = birthday;
    }

    @Basic
    @Column(name = "cookies")
    public String getCookies() {
        return cookies;
    }

    public void setCookies(String cookies) {
        this.cookies = cookies;
    }

    @Basic
    @Column(name = "sa_levelen")
    public String getSaLevelen() {
        return saLevelen;
    }

    public void setSaLevelen(String saLevelen) {
        this.saLevelen = saLevelen;
    }

    @Basic
    @Column(name = "level_value", columnDefinition = "int default 0"  )
    public Integer getLevelValue() {
        return levelValue;
    }


    public void setLevelValue(Integer levelValue) {
        this.levelValue = levelValue;
    }
    @Basic
    @Column(name = "wait_receive" )
    public Integer getWaitReceive() {
        return waitReceive;
    }

    public void setWaitReceive(Integer waitReceive) {
        this.waitReceive = waitReceive;
    }
    @Basic
    @Column(name = "wait_comment")
    public Integer getWaitComment() {
        return waitComment;
    }

    public void setWaitComment(Integer waitComment) {
        this.waitComment = waitComment;
    }
}
